package pretice.p1;

public class Pretice extends Thread{
    static int num;
    @Override
    public void run() {
        while (true){
            synchronized (Pretice.class){
                if (num>100){
                    break;
                }
                if (num%2!=0){
                    System.out.println(Thread.currentThread().getName()+":"+num);
                }
                num++;
            }
        }
    }
}
